import { findTypeByValue, findTypeByLabel } from '@/utils/findType'
import * as types from "./types"

// 渠道Table
export const configTableFrame = [
  { 
    prop: "num", 
    label: "序号", 
    minWidth: "50px", 
    tooltip: true 
  },
  { 
    prop: "title", 
    label: "标题", 
    minWidth: "150px"
  },
  { 
    prop: "userId", 
    label: "医生", 
    minWidth: "150px"
  },
  { 
    prop: "hospital", 
    label: "医院", 
    minWidth: "150px"
  },
  { 
    prop: "name", 
    label: "作者", 
    minWidth: "150px"
  },
  { 
    prop: "detail", 
    label: "详细", 
    minWidth: "500px"
  },
  { 
    prop: "status", 
    label: "状态",
    minWidth: "100px",
    formatter: (row) => {
      return findTypeByValue(row.status, types.statusType);
    }
  },
  {
    prop: "thumb",
    label: "焦点图",
    slotName: "thumb", 
    minWidth: "250px"
  },
  {
    prop: "videoUrl",
    label: "视频链接",
    minWidth: "100px"
  },
  {
    prop: "createTime",
    label: "创建时间",
    minWidth: "100px"
  },
  { 
    label: "操作", 
    slotName: "operate", 
    fixed: "right",
    minWidth: "150px"
  },
];


export const searchFrame = [
  { 
    label: "标题", 
    key: "title", 
    type: 1
  }
]
